abstract public class InstrMaqP {

	/** Atributos **/

		private static IApilaTrue iapilaTrue = null;
		private static IApilaFalse iapilaFalse = null;
	
		private static IEQ ieq = null;
		private static INEQ ineq = null;
		private static IGT igt = null;
		private static IGE ige = null;
		private static ILT ilt = null;
		private static ILE ile = null;

		private static ISuma isuma = null;
		private static IResta iresta = null;
		private static IOr ior = null;

		private static IMul imul = null;
		private static IDiv idiv = null;
		private static IAnd iand = null;

		private static IMenos imenos = null;
		private static INot inot = null;

		public enum ICOD {
			EQ, NEQ, GT, GE, LT, LE, SUM, RES, OR, MUL, DIV, AND, MENOS, NOT, DESAPILA, IR_F, IR_A, APILA_TRUE, APILA_FALSE, APILA_NUM, APILA_DIR
		};

	/** Metodos **/

		abstract public ICOD ci();

		public int arg1() {
			throw new UnsupportedOperationException("arg1");
		}

		public static class IEQ extends InstrMaqP {
			private IEQ() {;}

			public ICOD ci() {
				return ICOD.EQ;
			}

			public String toString() {
				return "EQ";
			}
		}

		public static class INEQ extends InstrMaqP {
			private INEQ() {;}

			public ICOD ci() {
				return ICOD.NEQ;
			}

			public String toString() {
				return "NEQ";
			}
		}

		public static class IGT extends InstrMaqP {
			private IGT() {;}

			public ICOD ci() {
				return ICOD.GT;
			}

			public String toString() {
				return "GT";
			}
		}

		public static class IGE extends InstrMaqP {
			private IGE() {;}

			public ICOD ci() {
				return ICOD.GE;
			}

			public String toString() {
				return "GE";
			}
		}

		public static class ILT extends InstrMaqP {
			private ILT() {;}

			public ICOD ci() {
				return ICOD.LT;
			}

			public String toString() {
				return "LT";
			}
		}

		public static class ILE extends InstrMaqP {
			private ILE() {;}

			public ICOD ci() {
				return ICOD.LE;
			}

			public String toString() {
				return "LE";
			}
		}

		public static class ISuma extends InstrMaqP {
			private ISuma() {;}

			public ICOD ci() {
				return ICOD.SUM;
			}

			public String toString() {
				return "SUMA";
			}
		}

		public static class IResta extends InstrMaqP {
			private IResta() {;}

			public ICOD ci() {
				return ICOD.RES;
			}

			public String toString() {
				return "RESTA";
			}
		}

		public static class IOr extends InstrMaqP {
			private IOr() {;}

			public ICOD ci() {
				return ICOD.OR;
			}

			public String toString() {
				return "OR";
			}
		}

		public static class IMul extends InstrMaqP {
			private IMul() {;}

			public ICOD ci() {
				return ICOD.MUL;
			}

			public String toString() {
				return "MUL";
			}
		}

		public static class IDiv extends InstrMaqP {
			private IDiv() {;}

			public ICOD ci() {
				return ICOD.DIV;
			}

			public String toString() {
				return "DIV";
			}
		}

		public static class IAnd extends InstrMaqP {
			private IAnd() {;}

			public ICOD ci() {
				return ICOD.AND;
			}

			public String toString() {
				return "AND";
			}
		}

		public static class IMenos extends InstrMaqP {
			private IMenos() {;}

			public ICOD ci() {
				return ICOD.MENOS;
			}

			public String toString() {
				return "MENOS";
			}
		}

		public static class INot extends InstrMaqP {
			private INot() {;}
	
			public ICOD ci() {
				return ICOD.NOT;
			}

			public String toString() {
				return "NOT";
			}
		}

		public static class IApilaTrue extends InstrMaqP {

			private IApilaTrue() {;}

	        public ICOD ci() {
	        	return ICOD.APILA_TRUE;
	        }

	        public String toString() {
	        	return "apila_true()";
	        }
		}

		public static class IApilaFalse extends InstrMaqP {

			private IApilaFalse() {;}

	        public ICOD ci() {
	        	return ICOD.APILA_FALSE;
	        }

	        public String toString() {
	        	return "apila_false()";
	        }
		}

		public static class IApilaNum extends InstrMaqP {

			private int val;

			private IApilaNum(String val) {
				try {
					this.val = Integer.parseInt(val);
				} catch (NumberFormatException e) {
					this.val = 0;
				}
			}

			public ICOD ci() {
				return ICOD.APILA_NUM;
			}

			public int arg1() {
				return val;
			}

			public String toString() {
				return "apila_num(" + val + ")";
			}
		}
		
		public static class IApilaDir extends InstrMaqP {

			private int val;

			private IApilaDir(String val) {
				try {
					this.val = Integer.parseInt(val);
				} catch (NumberFormatException e) {
					this.val = 0;
				}
			}

			public ICOD ci() {
				return ICOD.APILA_DIR;
			}

			public int arg1() {
				return val;
			}

			public String toString() {
				return "apila_dir(" + val + ")";
			}
		}

		public static class IDesapilaDir extends InstrMaqP {

			private int val;

			private IDesapilaDir(String val) {
				try {
					this.val = Integer.parseInt(val);
				} catch (NumberFormatException e) {
					this.val = 0;
				}
			}

			public ICOD ci() {
				return ICOD.DESAPILA;
			}

			public int arg1() {
				return val;
			}

			public String toString() {
				return "desapila_dir(" + val + ")";
			}
		}
	
		public static InstrMaqP nuevaIEQ() {
			if (ieq == null) {
				ieq = new IEQ();
			}
			return ieq;
		}
	
		public static InstrMaqP nuevaINEQ() {
			if (ineq == null) {
				ineq = new INEQ();
			}
			return ineq;
		}
	
		public static InstrMaqP nuevaIGT() {
			if (igt == null) {
				igt = new IGT();
			}
			return igt;
		}
	
		public static InstrMaqP nuevaIGE() {
			if (ige == null) {
				ige = new IGE();
			}
			return ige;
		}
	
		public static InstrMaqP nuevaILT() {
			if (ilt == null) {
				ilt = new ILT();
			}
			return ilt;
		}
	
		public static InstrMaqP nuevaILE() {
			if (ile == null) {
				ile = new ILE();
			}
			return ile;
		}
	
		public static InstrMaqP nuevaISuma() {
			if (isuma == null) {
				isuma = new ISuma();
			}
			return isuma;
		}
	
		public static InstrMaqP nuevaIResta() {
			if (iresta == null) {
				iresta = new IResta();
			}
			return iresta;
		}
	
		public static InstrMaqP nuevaIOr() {
			if (ior == null) {
				ior = new IOr();
			}
			return ior;
		}
	
		public static InstrMaqP nuevaIMul() {
			if (imul == null) {
				imul = new IMul();
			}
			return imul;
		}
	
		public static InstrMaqP nuevaIDiv() {
			if (idiv == null) {
				idiv = new IDiv();
			}
			return idiv;
		}
	
		public static InstrMaqP nuevaIAnd() {
			if (iand == null) {
				iand = new IAnd();
			}
			return iand;
		}
	
		public static InstrMaqP nuevaIMenos() {
			if (imenos == null) {
				imenos = new IMenos();
			}
			return imenos;
		}
	
		public static InstrMaqP nuevaINot() {
			if (inot == null) {
				inot = new INot();
			}
			return inot;
		}
	
		public static InstrMaqP nuevaIApilaTrue() {
			if (iapilaTrue == null) {
				iapilaTrue = new IApilaTrue();
			}
			return iapilaTrue;
		}
		
		public static InstrMaqP nuevaIApilaFalse() {
			if (iapilaFalse == null) {
				iapilaFalse = new IApilaFalse();
			}
			return iapilaFalse;
		}
		
		public static InstrMaqP nuevaIApilaNum(String val) {
			return new IApilaNum(val);
		}
		
		public static InstrMaqP nuevaIApilaDir(String val) {
			return new IApilaDir(val);
		}
	
		public static InstrMaqP nuevaIDesapilaDir(String val) {
			return new IDesapilaDir(val);
		}
	
		public static class IIr_a extends InstrMaqP {

			private int val;

			private IIr_a(int val) {
				this.val = val;
			}
	
			public ICOD ci() {
				return ICOD.IR_A;
			}
	
			public int arg1() {
				return val;
			}
	
			public String toString() {
				return "ir_a(" + val + ")";
			}

		}
	
		public static InstrMaqP nuevaIIr_a(int val) {
			return new IIr_a(val);
		}
	
		public static class IIr_f extends InstrMaqP {

			private int val;
			
			private IIr_f(int val) {
				this.val = val;
			}
	
			public ICOD ci() {
				return ICOD.IR_F;
			}
	
			public int arg1() {
				return val;
			}
	
			public String toString() {
				return "ir_f(" + val + ")";
			}

		}

		public static InstrMaqP nuevaIIr_f(int val) {
			return new IIr_f(val);
		}
}